package com.tenllo.bean;

import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

@Service
public class UserInfo {

    private int id;
    private int role;
    private int status;
    private int apptype;
    private String photo;
    private String phone;
    private String gender;
    private String birthday;
    private String user_name;
    private String nick_name;
    private String access_token;
    private String register_time;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getRole() {
        return role;
    }

    public void setRole(int role) {
        this.role = role;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getApptype() {
        return apptype;
    }

    public void setApptype(int apptype) {
        this.apptype = apptype;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    public String getUser_name() {
        return user_name;
    }

    public void setUser_name(String user_name) {
        this.user_name = user_name;
    }

    public String getNick_name() {
        return nick_name;
    }

    public void setNick_name(String nick_name) {
        this.nick_name = nick_name;
    }

    public String getAccess_token() {
        return access_token;
    }

    public void setAccess_token(String access_token) {
        this.access_token = access_token;
    }

    public String getRegister_time() {
        return register_time;
    }

    public void setRegister_time(String register_time) {
        this.register_time = register_time;
    }

    public static UserInfo Request2User(HttpServletRequest request, UserInfo userInfo) {
        try {
//            userInfo.setId(Integer.valueOf(request.getParameter("id")));
//            userInfo.setRole(Integer.valueOf(request.getParameter("role")));
//            userInfo.setStatus(Integer.valueOf(request.getParameter("status")));
//            userInfo.setApptype(Integer.valueOf(request.getParameter("apptype")));
//            userInfo.setPhoto(request.getParameter("photo"));
//            userInfo.setPhone(request.getParameter("phone"));
//            userInfo.setGender(request.getParameter("gender"));
//            userInfo.setBirthday(request.getParameter("birthday"));
//            userInfo.setUser_name(request.getParameter("user_name"));
            userInfo.setNick_name(request.getParameter("nick_name"));
//            userInfo.setAccess_token(request.getParameter("access_token"));
//            userInfo.setRegister_time(request.getParameter("register_time"));
        } catch (Exception e) {
            e.printStackTrace();
        }

        return userInfo;
    }
}
